import java.util.Scanner;
public class Zuoye9 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a[]={1,2,3,4};
        System.out.println("请输入要查找的号码：");
        int num=in.nextInt();
        int high,low,mid,b = 1;
        int n=4;
        high=n-1;
        low=0;
        while(low<=high)
        {
            mid = (high+low)/2;
            if(a[mid]<num)
            {
                low = mid+1;
            }
            else if(a[mid]>num)
            {
                high = mid -1;
            }
            else
            {
                System.out.println("位置在第"+(mid+1));
                System.out.println(a[mid]);
                b = 0;
                break;
            }
        }
        if(b!=0)
        {
            System.out.println("无此数字。");
        }
    }
}
